const BusConfig = require('./ProConfig')
module.exports = {
  productionSourceMap: false,
  lintOnSave: false,
  devServer: {
    port: 9992,
    client: {
      overlay: false,
    },
    // overlay: {
    //   warning: false,
    //   errors: false
    // }
  },
  css: {
    //查看CSS属于哪个css文件
    sourceMap: true
  },
  configureWebpack: {
    module: {
      rules: [
        {
          test: /\.mjs$/,
          include: /node_modules/,
          type: "javascript/auto"
        },
      ]
    }
  },
  chainWebpack: (config) => {
    // 移除 prefetch 插件
    config.plugins.delete('prefetch');
    //自下定义title
    config.plugin('html').tap((args) => {
      args[0].title = BusConfig.title;
      return args;
    });

    // 定义特性标志
    config.plugin('define').tap((definitions) => {
      Object.assign(definitions[0], {
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
      });
      return definitions;
    })
  }
};
